import { Form, Input } from 'antd';
import type React from 'react';

interface CustomerInfoFormProps {
  isEditMode?: boolean;
}

const CustomerInfoForm: React.FC<CustomerInfoFormProps> = ({
  isEditMode = false,
}) => {
  return (
    <>
      {isEditMode && (
        <Form.Item label="客户ID" name="customerID">
          <Input disabled />
        </Form.Item>
      )}
      <Form.Item
        label="PID"
        name="PID"
        rules={[{ required: true, message: '请输入PID' }]}
      >
        <Input />
      </Form.Item>
      <Form.Item
        label="客户姓名"
        name="customerName"
        rules={[{ required: true, message: '请输入客户姓名' }]}
      >
        <Input />
      </Form.Item>
      <Form.Item
        label="电话"
        name="telephone"
        rules={[{ required: true, message: '请输入电话号码' }]}
      >
        <Input />
      </Form.Item>
      <Form.Item
        label="地址"
        name="address"
        rules={[{ required: true, message: '请输入地址' }]}
      >
        <Input />
      </Form.Item>
      <Form.Item
        label={isEditMode ? '新密码' : '密码'}
        name="password"
        rules={isEditMode ? [] : [{ required: true, message: '请输入密码' }]}
      >
        <Input.Password placeholder={isEditMode ? '留空则不修改密码' : ''} />
      </Form.Item>
    </>
  );
};

export default CustomerInfoForm;
